﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace DataStructures
{
	public class Enumerator<Item> : IEnumerator<Item>
	{
		#region ctors
		public Enumerator(Item[] items) { _Items = items; Reset(); }
		#endregion ctors

		#region props
		public Item Current { get { return _Items[_Index]; } }
		object IEnumerator.Current { get { return Current; } }
		#endregion props

		#region methods
		public void Dispose()
		{
			//throw new NotImplementedException();
		}
		public bool MoveNext()
		{
			bool result = true;
			if (++_Index >= _Items.Length)
				result = false;
			return result;
		}
		public void Reset() { _Index = -1; }
		#endregion methods

		#region fields
		private int _Index;
		private Item[] _Items;
		#endregion fields
	}
}
